package main 


import (
"fmt"
"reflect"
"encoding/gob"
"bytes"
"io/ioutil"
"os"
)


func Fa(in interface{}){
  fmt.Println("ok",reflect.ValueOf(in).Kind())
}


type Studio interface{

  Start()
  Run()
}


type A struct{
Aa   int
Name string
}

type B struct{
bb   int
Name string
}



func main(){
   var ma = make([]reflect.Value,1)

   ma[0] = reflect.ValueOf(1)
   
   reflect.ValueOf(Fa).Call(ma)

   var sa = 10.11

   a1 := &A{Aa:1,Name:"jiang"}
   b1 := &bytes.Buffer{}
   g1 :=  gob.NewEncoder(b1)

   g1.Encode(a1)
   
   fmt.Println("ok",sa,b1)

   ioutil.WriteFile("/tmp/bobo.txt",b1.Bytes(),os.ModePerm)


   br,_ :=   ioutil.ReadFile("/tmp/bobo.txt")

   n :=   bytes.NewBuffer(br)

   g2 :=  gob.NewDecoder(n)

   var a2 A

   g2.Decode(&a2)

   fmt.Println("bbobbb ",a2.Name)

   z1 := B{bb:10}

   fmt.Println(z1.bb)

}
